﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _1stWpfPractice
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		//ChildWindows is window type file, not be page file. page is page which can include other page or window
		//Window is indiviaual unit, can show any UI controls.
		//string AdminID = "admin";
		//string AdminPassword = "123456";        
        StaffManagementPage staffManagementPage = new StaffManagementPage();

		public MainWindow()
		{
			InitializeComponent();

		}

        private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if ((textBox1.Text == "admin") && (textBox2.Text == "123456"))
            {
                staffManagementPage.Show();
            }
            else
            {
                MessageBox.Show("Wrong user ID or password. Please input the right user name and password.");
            }
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Cancle", " ", MessageBoxButton.OKCancel);
        }
	}
}
